﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Components;
using UI.Lib.Factory;
using UI.Lib.Set;
using UI.ParentForm;

namespace UI.StorageManagement
{
    public partial class FrmOrdSendPrint : BasePrint
    {
        public FrmOrdSendPrint()
        {
            InitializeComponent();

            this.Text = "发货单打印";
        }

        protected override void SetParam()
        {
            var listid = base.GetParamByKey("listid");

            var shopid = CommonHelper.Entity.ExecFunScalar("getordershop", QB.Entity.AddParam("listid", listid));

            this.ReportType = ShopSetting.PrintPrice(shopid) ? "" : "NP"; //UI.Lib.Context.GlobalBoolean("5") ? "" : "NP";
        }

        /// <summary>
        /// 设置报表名称
        /// </summary>
        /// <returns></returns>
        protected override Telerik.Reporting.Report SetReportName()
        {
            return new UI.Reports.OrdSendDocA4();
        }

        protected override DataTable SetReportSummaryData()
        {
            return UI.Lib.Factory.CommonHelper.Entity.ExecFun("printsenddocsum", new KeyValuePair<string, object>("listid", base.GetParamByKey("listid")));
        }

        //返回明细数据
        protected override DataTable SetReportDetailData()
        {
            return UI.Lib.Factory.CommonHelper.Entity.ExecFun("printsenddocdetail", new KeyValuePair<string, object>("listid", base.GetParamByKey("listid")));
        }
    }
}
